package com.win.mapreduce;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

public class WordCountPartitioner extends Partitioner<Text, IntWritable> {
    //<Text, IntWritable> 为mapTask输出的键值对的数据类型
    @Override
    public int getPartition(Text text, IntWritable intWritable, int i) {
        char c = text.toString().charAt(0);

        if (c > 'A' && c < 'Z'){
            return 0;
        }else {
            return 1;
        }
    }
}
